<!DOCTYPE html>
<script src="/js-test-resources/js-test.js"></script>
<body>
<script>
window.jsTestIsAsync = true;
description('Test that resolving a promise after the window gets closed does not assert or crash');

if (window.testRunner) {
    testRunner.setPopupBlockingEnabled(false);
    openWindow();
} else {
    document.write('<p>Click <a href="javascript:openWindow()">this link</a>.  A window should open and close without asserting or crashing.</p>');
}

function openWindow() {
    window.open('resources/resolve-after-window-close.html');
}

function done() {
    finishJSTest();
}
</script>
</body>
